import axios from "axios";
import {
  ElMessage
} from "element-plus";
import pinia from "@/store/pinia";
import {
  useMapStore
} from "@/store/map";
const mapStore = useMapStore(pinia);

const getAjaxTableData = async (currentPage, pageSize, orderBy, sort, queryInfo) => {
  // let ajaxGetVehicleRes = await axios
  //   .post("http://192.168.66.45:18766/person/list", {
  //     queryInfo: obj,
  //   })
  //   .then((ajaxGetVehicleRes) => [null, ajaxGetVehicleRes])
  //   .catch((err) => [err, null]);

  // if (!ajaxGetVehicleRes[1]) {
  //   console.log(ajaxGetVehicleRes[1].data.message);
  //   ElMessage({
  //     message: ajaxGetVehicleRes[1].data.message,
  //     type: "error",
  //   });
  //   return false;
  // }

  // ajaxGetVehicleRes = ajaxGetVehicleRes[1];

  // console.log("ajaxGetVehicleRes：");
  // console.log(ajaxGetVehicleRes);

  // const personalData = ajaxGetVehicleRes.data;

  mapStore.tableData = [
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
    {
      name: "123456",
      IDNumber: "430726196511010016",
      photo: "20240607/430726196511010016盛孝波.jpg",
      sex: "男",
      licensePlateNumber: "湘 L",
      phone: "12345678900",
      address: "湖南益阳石门县"
    },
  ];
  mapStore.total = 16;
  console.log({currentPage, pageSize, orderBy, sort});
  mapStore.loading = false;
};

export {
  getAjaxTableData
};